package pers.cz.netty.handle;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.socket.DatagramPacket;

/**
 * @program: JefLogTail
 * @description: UDP服务端普通消息处理，由使用者去继承实现
 * @author: Cheng Zhi
 * @create: 2023-03-29 16:07
 **/
public class UdpServerMessageHandler extends SimpleChannelInboundHandler<DatagramPacket> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, DatagramPacket datagramPacket) throws Exception {
        channelHandlerContext.writeAndFlush(datagramPacket.retain());
    }
}
